/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ceair.flight.refund.location.dt.enums;

/**
 * 申请单是否执行过自动一审, 0:未执行过, 1:已执行并通过 2: 已执行但未通过 3: "无需自动审核"
 *
 * @author youguilin
 */
public enum RefundAutoAuditEnum {

    DEFAULT(0, "未执行"),
    PASS(1, "已执行并通过"),
    FAIL(2, "已执行但未通过"),
    NO_AUTO(3, "无需自动审核");

    /**
     * 简码
     */
    private final int code;

    /**
     * 描述
     */
    private final String description;

    private RefundAutoAuditEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    /**
     * @return Returns the code.
     */
    public int getCode() {
        return code;
    }

    /**
     * @return Returns the description.
     */
    public String getDescription() {
        return description;
    }

    /**
     * 通过枚举<code>code</code>获得枚举。
     *
     * @param code 简码
     * @return 枚举
     */
    public static RefundAutoAuditEnum getByCode(int code) {
        for (RefundAutoAuditEnum status : values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        return null;
    }
}
